package cn.spike.rockcc.web.controller;

import cn.spike.rockcc.result.JSONResult;
import cn.spike.rockcc.service.VerifyCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author:spike
 * @create:2023-03-08 18:35
 */
@RestController
@RequestMapping("/verifycode")
public class VerifycodeController {

    @Autowired
    private VerifyCodeService verifyCodeService;

    @GetMapping("/imageCode/{imageCodeKey}")
    public JSONResult imageCodeKey(@PathVariable("imageCodeKey")String imageCodeKey){
        return verifyCodeService.imageCodeKey(imageCodeKey);
    }

    @PostMapping("/sendSmsCode")
    public JSONResult sendSmsCode(@RequestBody Map<String,String> map){
        return verifyCodeService.sendSmsCode(map);
    }
}
